package com.example.demo.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.bean.ApiResponse;

@RestController
@RequestMapping("/api/protected")
public class ProtectedController {

    @GetMapping
    public ResponseEntity<ApiResponse<String>> getProtected() {
        ApiResponse<String> response = new ApiResponse<>(true, "Access to protected resource granted", "This is a protected resource");
        return ResponseEntity.ok(response);
    }
}